<script type="text/javascript">
function ChangeBulkAction(v)
{	
    if(document.getElementById(v).value == 'status')
   		document.getElementById("changestatus").style.display="inline";
   	else
   		document.getElementById("changestatus").style.display="none";
}
</script>

<div class="box white_bg">

<form action="/en/article/index/bulk" method="POST">
<table border = '1' width='100%'>
	<tr>
		<td>
			
		</td>
		<td>
			<?=t(27) ?>
		</td>
		<td>
			<?=t(13) ?>
		</td>
		<td>
			 <?=t(14) ?>
		</td>
		<td>
			 <?=t(2) ?>
		</td>
		<td>
			 <?=t(81) ?>
		</td>
		<td>
			<?=t(88) ?>
		</td>
		<td>
			 <?=t(84) ?>
		</td>
		<td>
			<?=t(89) ?>
		</td>
		<td>
			<?=t(526) ?>
		</td>
		<td>
			<?=t(29) ?>
		</td>
	</tr>
	<?if(isset($this->viewParams['paginator'])) :?>
	<? foreach ($this->viewParams['articleList'] as $row) :?>
	<tr>
		<td>
			<input type="checkbox" value="<?=$row['article_id'] ?>" id="edit-article-<?=$row['article_id'] ?>" name="articles[<?=$row['article_id'] ?>]"/>
		</td>
		<td>
			#<?=$row['article_id']?>
		</td>
		<td>
			<a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'view'))?>?id=<?=$row['article_id']?>" > <?=$row['article_title'] ?></a>
		</td>
		<td>
			<?=$row['article_module'] ?>
		</td>
		<td>
			<?=$row['article_status'] ?>
		</td>
		<td>
			<?=Zend_Registry::get('configuration')->languagename->{$row['article_language']} ?>
		</td>
		<td>
			<?=$row['article_poster_id'] ?>
		</td>
		<td>
			<?=date("d.m.y", $row['article_post_time'])  ?>
		</td>
		<td>
			<?=$this->translated[$row['article_id']] ?>
		</td>
		<td>
			<?=$row['article_originality'] ?>
		</td>
    	<td width="20%"><a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'edit'))?>?id=<?=$row['article_id']?>"><?=t(38) ?></a>
            <a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'delete'))?>?id=<?=$row['article_id']?>"><?=t(31) ?></a>
            <a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'translate'))?>?id=<?=$row['article_id']?>"><?=t(90) ?></a>
        </td> 
	</tr>
	<?endforeach ?>
	<?endif?>
</table>

<br />
<div style="width:100%;float: right" id = "paging">
<?if(isset($this->viewParams['paginator'])) :?>
<?= $this->paginationControl($this->viewParams['paginator'], 'Sliding', '/modules/article/views/scripts/commonTheme/commonLang/common/admin_pagination_control.phtml'); ?>
<?endif?>
</div>
<br />

<div  style="background-color:#EEEEEE">

<?=t(30) ?>: 
<select name='bulkaction' id ="bulk" onchange = "ChangeBulkAction('bulk')">
<option value='delete'><?=t(31) ?></option>
<option value='status'> <?=t(32) ?></option>
</select>

<select name='changestatus' id ="changestatus" style=" display:none">
<option value='published'> <?=t(34) ?> </option>
<option value='queued'> <?=t(35) ?> </option>
<option value='unpublished'> <?=t(36) ?> </option>
<option value='deleted'> <?=t(37) ?> </option>
</select>
<input type="submit" value="Apply" id="edit-submit" name="op"/>
</div>
</form>
<br/>
<?=t(511) ?> <a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'new'))?>"> <?=t(9) ?> </a>

</div>